using System;
using System.Drawing;
using System.IO;
using System.Reflection;
using HmFramework.IO;

namespace CuteSprite.Eme.UI.BsdUserCenter.Resources
{
	/// <summary>Resource manager.</summary>
	internal sealed class ResManager
	{
		#region method GetIcon

		/// <summary>Gets specified icon.</summary>
		/// <param name="iconName">Icon name.</param>
		/// <returns>Returns specified icon.</returns>
		public static Icon GetIcon(String iconName)
		{
			return GetIcon(iconName, 32);
		}

		/// <summary>Gets specified icon.</summary>
		/// <param name="iconName">Icon name.</param>
		/// <param name="size">Icon size.</param>
		/// <returns>Returns specified icon.</returns>
		public static Icon GetIcon(String iconName, Int32 sizeWH)
		{
			return FileSource.GetIcon(Assembly.GetExecutingAssembly(), typeof(ResManager).Namespace + "." + iconName, sizeWH, false);
		}

		#endregion

		#region method GetImage

		/// <summary>Gets specified image.</summary>
		/// <param name="imageName">Image name.</param>
		/// <returns></returns>
		public static Image GetImage(String imageName)
		{
			return FileSource.GetImage(Assembly.GetExecutingAssembly(), typeof(ResManager).Namespace + "." + imageName, false);
		}

		#endregion

		#region method GetFile

		/// <summary>Gets specified file.</summary>
		/// <param name="fileName">File name.</param>
		/// <returns></returns>
		public static Stream GetFile(String fileName)
		{
			return FileSource.GetFileResource(Assembly.GetExecutingAssembly(), typeof(ResManager).Namespace + "." + fileName, false);
		}

		#endregion
	}
}